﻿using MiniExcelLibs.Attributes;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace Zhp.Model.Message.Email
{
    /// <summary>
    /// 列表返回字段
    /// </summary>
    public class EmailAccountModel
    {
        public long Id { get; set; }

        /// <summary>
        ///电子邮件地址
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// 电子邮件显示名称
        /// </summary>
        public string DisplayName { get; set; }

        /// <summary>
        /// 电子邮件主机
        /// </summary>
        public string Host { get; set; }

        /// <summary>
        /// 电子邮件端口
        /// </summary>
        public int Port { get; set; }

        /// <summary>
        /// 电子邮件用户名
        /// </summary>
        public string Username { get; set; }

        /// <summary>
        /// 电子邮件密码
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 是否SSL
        /// </summary>
        public bool EnableSsl { get; set; }

        /// <summary>
        /// 是否与请求一起发送应用程序的默认系统凭据
        /// </summary>
        public bool UseDefaultCredentials { get; set; }
    }

    /// <summary>
    /// 列表查询参数
    /// </summary>
    public class QueryEmailAccountParam : PageModel
    {

    }

    /// <summary>
    /// 新增和编辑参数
    /// </summary>
    public class EditEmailAccountParam
    {
        /// <summary>
        /// 主键
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        ///电子邮件地址
        /// </summary>
        [Required]
        [EmailAddress]
        public string Email { get; set; }

        /// <summary>
        /// 电子邮件显示名称
        /// </summary>
        [Required]
        public string DisplayName { get; set; }

        /// <summary>
        /// 电子邮件主机
        /// </summary>
        [Required]
        public string Host { get; set; }

        /// <summary>
        /// 电子邮件端口
        /// </summary>
        [Required]
        public int Port { get; set; }

        /// <summary>
        /// 电子邮件用户名
        /// </summary>
        [Required]
        public string Username { get; set; }

        /// <summary>
        /// 电子邮件密码
        /// </summary>
        [Required]
        public string Password { get; set; }

        /// <summary>
        /// 是否SSL
        /// </summary>
        public bool EnableSsl { get; set; } = false;

        /// <summary>
        /// 是否与请求一起发送应用程序的默认系统凭据
        /// </summary>
        public bool UseDefaultCredentials { get; set; } = false;
    }

    /// <summary>
    /// 模板选择邮箱账户下拉框数据
    /// </summary>
    public class EmailAccountSelect
    {
        public long Id { get; set; }
        /// <summary>
        /// 电子邮件显示名称
        /// </summary>
        public string Email { get; set; }
    }

    public class EmailAccountExcel
    {
        [ExcelColumn(Name = "ID")]
        public long Id { get; set; }

        /// <summary>
        ///电子邮件地址
        /// </summary>
        [ExcelColumn(Name = "邮箱")]
        public string Email { get; set; }

        /// <summary>
        /// 电子邮件显示名称
        /// </summary>
        [ExcelColumn(Name = "邮箱名称")]
        public string DisplayName { get; set; }

        /// <summary>
        /// 电子邮件主机
        /// </summary>
        [ExcelColumn(Name = "主机")]
        public string Host { get; set; }

        /// <summary>
        /// 电子邮件端口
        /// </summary>
        [ExcelColumn(Name = "端口")]
        public int Port { get; set; }

        /// <summary>
        /// 电子邮件用户名
        /// </summary>
        [ExcelColumn(Name = "用户名")]
        public string Username { get; set; }

        /// <summary>
        /// 电子邮件密码
        /// </summary>
        [ExcelColumn(Name = "密码")]
        public string Password { get; set; }

        /// <summary>
        /// 是否SSL
        /// </summary>
        [ExcelColumn(Name = "是否SSL")]
        public bool EnableSsl { get; set; }

        /// <summary>
        /// 是否与请求一起发送应用程序的默认系统凭据
        /// </summary>
        [ExcelColumn(Name = "系统发送凭据")]
        public bool UseDefaultCredentials { get; set; }
    }
}
